Public Class UcnDesktop
    'represents UcnTabControl and menus & toolbars on a form

#Region "Attributes"
#Region "Private attributes"
    Private MbReadyForUse As Boolean = False 'indicates proper initialization of usercontrol
#End Region
#End Region
#Region "Constructors & Init"
    Sub New()

        ' This call is required by the Windows Form Designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.


        '**********************************************************************
        InitControl()
        '**********************************************************************
    End Sub
    'setting usercontrol settings after it is created
    Private Function InitControl() As GeActionResult
        SetReadyForUse(False) 'disabling usercontrol
        Try
            ucnTabControlUC.Dock = DockStyle.Fill
            SetReadyForUse(True) 'enabling usercontrol
            Return GeActionResult.kkOk
        Catch ex As Exception
            LogEventFromException(ex, , , )
            Return GeActionResult.kkError
        End Try
    End Function
#End Region
#Region "Properties"
#Region "Public properties"
    Public ReadOnly Property ReadyForUse() As Boolean
        Get
            Return MbReadyForUse
        End Get
    End Property
#End Region
#End Region
#Region "Functions"

#End Region
#Region "Subs"
    'sets MbReadyForUse attribute and sets Enable property of usercontrol
    Private Sub SetReadyForUse(ByVal IbValue As Boolean)
        MbReadyForUse = IbValue
        Me.Enabled = IbValue 'enabling usercontrol
    End Sub
#End Region

    '#######################################
    'execute function
    Public Function Execute(ByRef OoAction As ClsAction) As GeActionResult
        Try
            Dim LeResult As GeActionResult = GeActionResult.kkOk
            '---------------------------------------------
            'ACTION BEFORE ACTION
            '---------------------------------------------
            '---------------------------------------------
            'ACTION
            '---------------------------------------------
            Select Case OoAction.Action
                Case GeAction.kkSetDesktopForFirstUsage
                    'initialization of desktop for the first usage (setting ucnTabControl, menu & toolbars, some default settings...)
                    LeResult = ucnTabControlUC.Execute(OoAction)
                Case GeAction.kkAddTab
                    LeResult = ucnTabControlUC.Execute(OoAction)
                Case GeAction.kkaModSolutionOpenFile
                    LeResult = ucnTabControlUC.Execute(OoAction)
            End Select
            '---------------------------------------------
            'ACTION AFTER ACTION
            '---------------------------------------------
            Select Case OoAction.Action

            End Select
            '---------------------------------------------
            Return LeResult
            '---------------------------------------------

        Catch ex As Exception
            LogEventFromException(ex, , , )
            Return GeActionResult.kkError
        End Try
    End Function
    '#######################################

End Class
